let languageKeyList = []

export function setLanguageKeyList(languageKeys) {
	languageKeyList = languageKeys
}


export function formatLanguage(that, language) {
	let value
	languageKeyList.forEach(key => {
		if (key === language) {
			value = that.$t(key)
		}
	})
	if (value) {
		return value
	}
	return that.$t('unKnow')
}

export function listLanguage(that) {
	const languageList = []
	languageKeyList.forEach(key => {
		languageList.push({
			value: key,
			label: that.$t(key)
		})
	})
	return languageList
}


export function listTheme(that, language) {
	switch (language) {
		case 'zh':
			return [{
					value: 'orange',
					label: '活力橙'
				},
				{
					value: 'blue',
					label: '天空蓝'
				},
				{
					value: 'pink',
					label: '魅力粉'
				},
				{
					value: 'red',
					label: '热情红'
				},
				{
					value: 'green',
					label: '森林绿'
				}
			]
		default:
			return [{
					value: 'orange',
					label: '活力橙'
				},
				{
					value: 'blue',
					label: '天空蓝'
				},
				{
					value: 'pink',
					label: '魅力粉'
				},
				{
					value: 'red',
					label: '热情红'
				},
				{
					value: 'green',
					label: '森林绿'
				}
			]
			// [{
			// 		value: 'orange',
			// 		label: that.$t('orange')
			// 	},
			// 	{
			// 		value: 'blue',
			// 		label: that.$t('blue')
			// 	},
			// 	{
			// 		value: 'pink',
			// 		label: that.$t('pink')
			// 	},
			// 	{
			// 		value: 'red',
			// 		label: that.$t('red')
			// 	},
			// 	{
			// 		value: 'green',
			// 		label: that.$t('green')
			// 	}
			// ]
	}
}
